﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QlrrPrintService.Common.Command
{
    /// <summary>
    /// 將Image Buffer中指定的區域做反相的動作
    /// </summary>
    public class Reverse : PrintLocation, IToTSPLCommand
    {
        #region 变量

        private int _mm_to_dpi = Common.MM_TO_DPI;

        private int _width = 0;

        private int _height = 0;


        #endregion

        #region 属性

        public int Mm_to_dpi
        {
            get { return _mm_to_dpi; }
            set { _mm_to_dpi = value; }
        }

        public new int X
        {
            get { return _x * _mm_to_dpi; }
            set { _x = value; }
        }

        public new int Y
        {
            get { return _y * _mm_to_dpi; }
            set { _y = value; }
        }

        public int Width
        {
            get { return _width * _mm_to_dpi; }
            set { _width = value; }
        }

        public int Height
        {
            get { return _height * _mm_to_dpi; }
            set { _height = value; }
        }



        #endregion

        public byte[] ToTSPLCommandByte(int mm_to_dot)
        {
            throw new NotImplementedException();
        }

        public string ToTSPLCommandAscii(int mm_to_dot)
        {
            return string.Format("REVERSE {0},{1},{2},{3} {4}", _x * _mm_to_dpi, _y * _mm_to_dpi,
                _width * _mm_to_dpi, _height * _mm_to_dpi, Common.TSPL_END);
        }
    }
}
